export const toast = (obj) => {
  const maskDom = document.querySelector("mask-box");
  if (maskDom) {
    dom.removeChild(maskDom[0]);
  }
  const dom = document.body;
  const domcontent = `<view class='content-box'><i class='uni-icon_toast uni-icon-${obj.type}'></i><p class='text'>${obj.title}</p></view>`;
  const make = document.createElement("view");
  make.className += "mask-box";
  make.innerHTML = domcontent;
  dom.appendChild(make);
  const time = setTimeout(() => {
    dom.removeChild(make);
    obj.complete();
  }, obj.duration || 1500);
};
export default toast;
